//第一步：显示密码输入框
pwdctl = document.getElementById("pwd");
if(!pwdctl){
pwdctl = document.getElementById("password");
}
pwdctl.type="password";

function isBatchMode(){
	fname = "batch_payment_action.htm";
	return window.location.pathname.substr(-fname.length) === fname;
}
//第二步：提交表单
function getQueryVariable(variable) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
      return pair[1];
    }
  }
  return null;
} 
form = pwdctl.form;
pwd = form.password.value;
if(pwd){
	if( typeof checkUserOperation === 'function' || typeof checkUserOperationWithBatchTradeNo === 'function' ) {
		if(isBatchMode()){
			fn = checkUserOperationWithBatchTradeNo;
			tradeno = eval(form.tradeNOs.value);
		} else {
			fn = checkUserOperation;
			tradeno = getQueryVariable("tradeNo");
		}

		if(DWREngine){
			DWREngine.setAsync(false);
			fn(tradeno,pwd);
			DWREngine.setAsync(true);
		}
	}
	form.submit();
}
